package com.ithuaxin.comprehensiveractice;

import java.util.Scanner;

public class Test1 {
    public static void main(String[] args) {
        double money;
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入机票原价");
        double price = sc.nextDouble();
        System.out.println("请输入机票的月份");
        int month = sc.nextInt();
        System.out.println("请输入机票的舱型");
        String type = sc.next();
        if (month>=5 && month<=10){
            if (type.equals("经济舱")){
                money = price * 0.85;
                System.out.println("机票的最新价格为："+money);
            }
            else if (type.equals("头等舱")){
                    money = price * 0.9;
                    System.out.println("机票的最新价格为："+money);
                }
                else{
                    System.out.println("您输入的舱型错误");
                }

        }
        else if ((month>=11 && month<=12)||(month>=1 && month<=4)){
            if (type.equals("经济舱")){
                money = price * 0.65;
                System.out.println("机票的最新价格为："+money);
            }
            else if (type.equals("头等舱")){
                    money = price * 0.7;
                    System.out.println("机票的最新价格为："+money);
                }
                else{
                    System.out.println("您输入的舱型错误");
                }

        }
        else{
            System.out.println("您输入的月份错误");
        }

    }
}
